import React,{useEffect} from 'react'

function MyComponent() {
    console.log('MyComponent 更新了');
  return (
    <div>
      MyComponent
    </div>
  )
}
const setSatisfactionClass=(level)=>{
    if(level<100){
        return 'very-dissatisfied';
    }
    if(level<200){
        return 'somewhat-dissatisfied';
    }
    if(level<300){
        return 'nether';
    }
    if(level<400){
        return 'somewhat-satisfied';
    }
    return 'very-satisfied';
}
// props level 
const isSameRange=(prevValue,nextValue)=>{
    // console.log(preveValue,nextValue,'////')
    const prevValueClass=setSatisfactionClass(prevValue.level);
    const nextValueClass=setSatisfactionClass(nextValue.level);
    return prevValueClass===nextValueClass
}
// 
export default React.memo(MyComponent,isSameRange)
